import {LIST_SESSIONS,DELETE_SESSION,CREATE_SESSION,GET_SESSION_STATUS,CLOSE_SESSION} from '@/services/api'
import {request, METHOD} from '@/utils/request'



export function getSessionsInfo() {
    return request(LIST_SESSIONS, METHOD.POST)
}

export async function createSession(assetsId) {
    let data = new FormData();
    data.append('assetsId',assetsId);
    return request(CREATE_SESSION, METHOD.POST,data)
}

export async function deleteSession(sessionId) {
    let data = new FormData();
    data.append('sessionId',sessionId);
    return request(DELETE_SESSION, METHOD.POST,data)
}
export function getSessionStatus(sessionId) {
    let data = new FormData();
    data.append('sessionId',sessionId);
    return request(GET_SESSION_STATUS, METHOD.POST,data)
}
export async function closeSession(sessionId) {
    let data = new FormData();
    data.append('sessionId',sessionId);
    return request(CLOSE_SESSION, METHOD.POST,data)
}

export default {
    getSessionsInfo,
    createSession,
    deleteSession,
    getSessionStatus,
    closeSession
}
